/////////////////////////////////////////////////////////////////////////////
// Name:        ax_menu_alert.h
// Purpose:     Modal alert menu class, an equivalent of wxMessageBox.
// Author:      Julian Smart
// Modified by:
// Created:     2009-03-20
// RCS-ID:
// Copyright:   (c) Julian Smart
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _AX_MENU_ALERT_H_
#define _AX_MENU_ALERT_H_

/*
 * Includes
 */

#include "ax/ax_menu_modal.h"
#include "ax/ax_activator.h"
 
/**
    @class AxModalAlertMenu

    Shows a modal menu with a combination of Yes, No, OK, Cancel menu items
    in addition to the main menu item.

    Possible flags are:

    @li axALERT_NO_BUTTONS
    @li axALERT_YES_NO
    @li axALERT_OK
    @li axALERT_CANCEL

    If you use axALERT_NO_BUTTONS, only the main (only) menu item can be activated,
    and AxIdentifierOK will be returned from ShowModal.

    @category{ax}

 */

#define axALERT_NO_BUTTONS  0x0000
#define axALERT_YES_NO      0x0001
#define axALERT_OK          0x0002
#define axALERT_CANCEL      0x0004

#define AxIdentifierMainItem wxT("MAINITEM")

class AxModalAlertMenu: public AxModalMenu
{
    DECLARE_CLASS( AxModalAlertMenu )

public:
// Constructors

    AxModalAlertMenu() { Init(); }

    AxModalAlertMenu(AxMenuController* controller, AxMenuItem* item,
        const wxString& menuLabel,
        const wxString& description,
        const wxString& mainItemLabel,
        int style = axALERT_NO_BUTTONS,
        const wxString& okItemLabel = _("OK"),
        const wxString& cancelItemLabel = _("Cancel"),
        const wxString& yesItemLabel = _("Yes"),
        const wxString& noItemLabel = _("No"),
        const wxString defaultId = AxIdentifierOK);
    
    ~AxModalAlertMenu() {}

// Operations

    void Init() {}

protected:

};

/**
   @class AxAlertMenuActivator

   Ends the modal menu when the item is activated.
   This is for implementation only.
 */

class AxAlertMenuActivator: public AxActivator
{
public:
    
    DECLARE_DYNAMIC_CLASS( AxAlertMenuActivator )

public:
// Constructors

    AxAlertMenuActivator(AxModalAlertMenu* menu = NULL) { Init(); m_alertMenu = menu; }
    AxAlertMenuActivator(const AxAlertMenuActivator& activator) { Init(); Copy(activator); }

// Operations

    void Init() { m_alertMenu = NULL; }

    void Copy(const AxAlertMenuActivator& activator);

    virtual AxActivator* Clone() const { return new AxAlertMenuActivator(*this); }

    virtual AxMenu* Activate(AxMenuController* controller, AxMenuItem* item);

    AxModalAlertMenu* GetModalAlertMenu() const { return m_alertMenu; }
    void SetModalAlertMenu(AxModalAlertMenu* menu) { m_alertMenu = menu; }

protected:
    AxModalAlertMenu*        m_alertMenu;
};

#endif
    // _AX_MENU_ALERT_H_
